Spread WPF Documentation
SetArray(Int32,Int32,Object[,],Boolean) Method
Example 


Row index
Column index
Array from which to set values
If true, set formulas; otherwise, set values.
Sets the values in the specified two-dimensional array of objects into the specified range of cells on this sheet.
Syntax
'Declaration
 
Public Overloads Sub SetArray( _
   ByVal row As System.Integer, _
   ByVal column As System.Integer, _
   ByVal value(,) As System.Object, _
   ByVal formula As System.Boolean _
) 
'Usage
 
Dim instance As Worksheet
Dim row As System.Integer
Dim column As System.Integer
Dim value() As System.Object
Dim formula As System.Boolean
 
instance.SetArray(row, column, value, formula)
public void SetArray( 
   System.int row,
   System.int column,
   System.object[,] value,
   System.bool formula
)

Parameters

row
Row index
column
Column index
value
Array from which to set values
formula
If true, set formulas; otherwise, set values.
Example
This example uses the SetArray method.
object[,] arr;
gcSpreadSheet1.ActiveSheet.SetArray(1, 0, new String[,] { { "One", "Two" } });
gcSpreadSheet1.ActiveSheet.SetArray(2, 1, new String[,] { { "Three", "Four" } }, false);
arr = gcSpreadSheet1.ActiveSheet.GetArray(1, 0, 3, 2);
gcSpreadSheet1.ActiveSheet.Cells[3, 3].Text = "The value of the first element in the array is " + arr.GetValue(0, 0).ToString();
Dim arr(,) As Object
GcSpreadSheet1.ActiveSheet.SetArray(1, 0, New String(,) {{"One", "Two"}})
GcSpreadSheet1.ActiveSheet.SetArray(2, 1, New String(,) {{"Three", "Four"}}, False)
arr = GcSpreadSheet1.ActiveSheet.GetArray(1, 0, 3, 2)
GcSpreadSheet1.ActiveSheet.Cells(3, 3).Text = "The value of the first element in the array is " & arr.GetValue(0, 0).ToString()
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional (SP4), Windows XP (SP2), Windows 2008, Windows 2003 Server (SP1)

See Also

Reference

Worksheet Class
Worksheet Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.